#!/usr/bin/ruby
# Author: Foung Vang
# Assignment: Basic #2

num_array = [3, 5, 1, 2, 7, 9, 8, 13, 25, 32]
puts num_array.inject(:+)
puts num_array.reject{ |a| a < 10 }
puts num_array.find_all{ |a| a > 10 }


name_array = ["John", "KB", "Oliver", "Cory", "Matthew", "Christopher"]
puts name_array.shuffle()
puts name_array.reject{ |a| a.length < 5 };


alpha_array = [*('a'..'z')]
puts alpha_array.shuffle().last
puts alpha_array.shuffle().first


first_char = alpha_array.shuffle().first
puts first_char # debugging purpose
case first_char
when 'a','e','i','o','u'
	puts "First character is a vowel!"
else
	puts "First character is not a vowel!"
end

rand_num_array = (1..10).collect {rand(55..100)}
puts rand_num_array.sort

puts "\nSorting...\n"
puts rand_num_array.sort

puts "\nMin & Max\n"
puts rand_num_array.minmax

puts (1..5).map { |x| (65 + rand(26)).chr }.join

new_array = Array.new
for i in 1..10
	temp = (1..5).map { |x| (65 + rand(26)).chr }.join
	new_array.push(temp)
end
puts new_array.inspect
